import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import 'element-plus/dist/index.css'
import ElementPlus, { ElMessage } from 'element-plus'
import App from './App.vue'
import router from './router'
import webSentinelSDK from '@monofe/web-sentinel-sdk'
const app = createApp(App)
app.use(ElementPlus)
app.use(createPinia())
app.use(router)
app.use(webSentinelSDK, {
  url: 'http://localhost:9800/reportData',
  projectName: '12345',
  appId: '12345',
  userId: '12345',
  batchSize: 3,
})

// app.config.errorHandler = (err: any, vm) => {
//   const errorStack = ErrorStackParser.parse(err as Error)
//   const jsError = {
//     stack_frames: errorStack,
//     message: err.message,
//     stack: err.stack,
//     error_name: err.name,
//   }
//   ElMessage.error(`您触发了一个${err.name} 错误`)
//   localStorage.setItem('jsErrorList', JSON.stringify(jsError))
// }

app.mount('#app')
